import os
import numpy as np
import pandas as pd


train_dir = "/home/datanfs/macong_data/tencent_data/train_preliminary"
ad_csvf = "ad.csv"

# 查看ad_csv文件中
def look_at_ad():
    ad_dir = os.path.join(train_dir, ad_csvf)
    df_ad = pd.read_csv(ad_dir)
    print(df_ad.columns)
    product_id = df_ad["product_id"]
    a = product_id[0]
    print(a, type(a))
    if a == "\\N":
        print("is true")
    else:
        print("not true")


def look_null_ad():
    ad_dir = os.path.join(train_dir, ad_csvf)
    df_ad = pd.read_csv(ad_dir)
    df_null_product_id = df_ad.loc[df_ad["product_id"] == "\\N"]
    df_null_industry = df_ad.loc[df_ad["industry"] == "\\N"]
    print("predict_id中的null值: ", len(df_null_product_id))
    print("industry中的null值:", len(df_null_industry))



def fill_null_data():
    pass

if __name__ == '__main__':
    # look_at_ad()
    look_null_ad()